Previously introduced the use of JAX-WS to publish WebService, today a brief introduction to cxf.
Step 1: Create a Java Project
Various jar packages related to cxf provide a variety of functions, just create a Java Project
Step 2, introduce the relevant jar package http://download.csdn.net/detail/duanml61/5068049
1. commons-logging-1.1.1.jar2. geronimo-activation_1.1_spec-1.0.2.jar (or Sun's activation jar)3. geronimo-annotation_1.0_spec-1.1.1.jar (JSR 250)4. geronimo-javamail_1.4_spec-1.6.jar (
strings.
Task137650.jar
Portal technology implements the required jar in SOA system integration applications
Utility.jar
Apache Open source organization provides tag library
Velocity-1.5.jar
A free open-source template framework
Wsdl4j-1.6.2.jar
WSDL file used to parse the service
Wss4j-1.5.4.jar
Create the jar required for CXF
Wstx-asl-3.2.6.
-util-6.1.21.jar
Neethi-2.0.4.jar
Saaj-api-1.3.jar
Saaj-impl-1.3.2.jar
Wsdl4j-1.6.2.jar
Wstx-asl-3.2.8.jar
XmlSchema-1.4.5.jar
Xml-resolver-1.2.jar
Cxf-2.2.4.jar
Optional. Add Spring jars to add Spring support for XML Configuration. The added jars are as follows:
Aopalliance-1.0.jar
Spring-core-2.5.5.jar
Spring-beans-2.5.5.jar
Spring-context-2.5.5.jar
Spring-web-2.5.5.jar
2) Write Service
A) Write Interface
@ WebService
Public interface HelloWorld {
recently developed WebService with cxf, I found that the jar package error is always reported, but I cannot copy all the downloaded files from the official website. There are dozens of downloads on the official website. This is from cxf: http://cxf.apache.org/download.html . As a result, I found out that the minimum jar package is as follows: cxf-2.3.3.jar geronimo-annotation_1.0_spec-1.1.1.jar geronimo-jaxws_2.2_spec-1.0.jar geronimo-stax-api_1.0_spec-1.0.1.jar geronimo-ws-metadata_2
, download the latest version of the CXF, download the address as shown below:
In the second step, copy the following jar files from the Lib folder in Cxf to our project's Webapp/web-inf/lib directory:
commons-logging-1.1.jar geronimo-activation_1.1_spec-1.0-M1.jar (or Sun's Activation jar) geronimo-annotation_1.0_spec-1.1.jar (JSR 250) geronimo-javamail_1.4_spec-1.0-M1.jar (or Sun's JavaMail jar) geronimo-servlet_2.5_spec-1.1-M1.jar (or Sun's Servlet jar) geronimo-ws-metadata_2.0_spec-1.1.1
Lib/log4j-1.2.15.jar Lib/mail-1.4.jar Lib/mex-1.6.2-impl.jar Lib/neethi-3.0.2.jar lib/ Regexp-1.2.jar Lib/tribes-6.0.16.jar Lib/woden-api-1.0m9.jar Lib/woden-impl-commons-1.0m9.jar lib/ Woden-impl-dom-1.0m9.jar Lib/wsdl4j-1.6.2.jar Lib/wstx-asl-3.2.9.jar Lib/xalan-2.7.0.jar Lib/xml-resolver-1.2.jar Lib/xmlbeans-2.3.0.jar Lib/xmlschema-1.4.7.jarMF File considerations:(1) The first line cannot be empty, there can be no blank lines between rows and rows
Memcached Client Usage ManualAuthor:cenwenchuEmail:wenchu.cenwc@alibaba-inc.comblog:http://blog.csdn.net/cenwenchu79/project:http://code.google.com/p/memcache-client-forjava/
Cache Client Interface DefinitionFigure 1 Memcached Cache Client interface class diagram
The Icache and Imemcachedcache interfaces are the cache's underlying interfaces, which define the basic cache operation, detailed in the appendix, and used in the form of demo and usage notices. Icachemanager is the cache lifecycle mana
-20040917.jar,wstx-asl-2.9.3.jar,xmlparserapis-2.6.2.jar,xmlschema-1.0.3.jar these bags.
4. For the service-side narrow interface method, in the client only need to select their own methods to declare and implement it, but if the client's narrow interface declared in a service-side narrow interface defined methods, the following error occurs
Org.codehaus.xfire.XFireRuntimeException:Cannot Create mapping for java.util.List, unspecified component type
Label:Database access can be a bottleneck for many websites. Connection pool exhaustion, memory overflow, and so on. As already mentioned, if our site is a large distributed site, then using memcached to implement a database's front-end caching is a good choice, but if the site itself is small enough to have only one server, or even the kind of VPS, it is not recommended to use memcached, so Use Hibernate or the MyBatis framework to bring your own cache system on the line. First, open memcached
classpathant
Solrj is a part of the 1.3.0 release. The jars required in the classpath for solrj are,
Commons-io-1.3.1.jar
Commons-httpclient-3.1.jar
Commons-codec-1.3.jar
Commons-logging-1.0.4.jar
Apache-solr-common-1.3.0.jar
Apache-solr-solrj-1.3.0.jar
If you are using an SOLR 1.2, add the Stax jars too. Do not forget to set the XML Parser
Geronimo-stax-api_1.0_spec-1.0.1.jar
Wstx-asl-3.2.7.jar
Stax-utils.j
Describes in detail the steps and methods for creating, publishing, and accessing the cxf service in the Tomcat container.
I. Server Side
1. Add a cxf package
1) Basic Package:
Commons-logging-1.1.1.jar
Geronimo-activation_1.1_spec-1.0.2.jar
Geronimo-annotation_1.0_spec-1.1.1.jar
Geronimo-javamail_1.4_spec-1.6.jar
Geronimo-jaxws_2.1_spec-1.0.jar
Geronimo-servlet_2.5_spec-1.2.jar
Geronimo-stax-api_1.0_spec-1.0.1.jar
Geronimo-ws-metadata_2.0_spec-1.1.2.jar
Jaxb-api-2.1.jar
Jaxb-impl-2.1.12.jar
Jet
client through WSDL:1. Use ant to generate the client. The ant script is as follows:
Note that the script has a binding parameter, which can be specified in two different ways:(1) jaxb (Java architecture for XML binding, https://jaxb.dev.java.net/): When this method is used, more request and resopnse classes are automatically generated.(2) xmlbeansThe call method is as follows: abcserviceclient client = new abcserviceclient ();String url = "http: // localhost: 8080/xfiretest/services/testservi
strings.
Task137650.jar
Portal technology implements the required jar in SOA system integration applications
Utility.jar
Apache Open source organization provides tag library
Velocity-1.5.jar
A free open-source template framework
Wsdl4j-1.6.2.jar
WSDL file used to parse the service
Wss4j-1.5.4.jar
Create the jar required for CXF
Wstx-asl-3.2.6.
: XFire 1.2 in Core libraries Spring-1.2.6.jar conflicts with Spring2 in the project. FIX: MyEclipse6.5 in window->preferences->myeclipse Enterprise workbench->project capabilites- >web services-xfire Select Spring-1.2.6.jar->remove->ok Method Two: You can also add a XFire framework to a common WEB project item by Right-click the project name >myeclipse>add XFire Web Service capabilities to make this project functional XFire project. Common exceptions when integrating spring WebService
differentiate, you can include all of the CXF and the third-party support class packages (. jar files) required by the runtime directly in your Web project.Where Cxf-2.0.2-incubator.jar is the binary package file for the CXF framework, contains all the modules (modules), and Cxf-manifest-incubator.jar is the list file manifest jar.The following jar packages are required for all CXF projects:Cxf.jar Commons-logging.jar Geronimo-activation.jar (or the Sun equivalent) Geronimo-annotation.jar (or t
CXF webService call error: "Cannot create a secure XMLInputFactory", cxfxmlinputfactory
Problem description:
The server uses the cxf --- 2.7.5 framework to publish a service, compress the project into a war package, and deploy it to tomcat for testing. There is no problem, however, the service can be released normally after the ear package is packaged and deployed on weblogic 10.3.6, but an error is reported during the soapui test call:
Cause:
I checked some official website information and fo
Core client: (for testing) Jersey-client.jar
JAXB support: (used in the advanced example) Jaxb-impl.jar,jaxb-api.jar. Activation.jar,stax-api.jar. Wstx-asl.jar
JSON support: (used in advanced examples) Jersey-json.jar
Developing REST ServicesNow. You have set up the environment for developing your first REST service. The service issues "Hello" to the client.To do this, you need to send all the REST requests to the Jersey container--D
strings.
Task137650.jar
Portal technology implements the required jar in SOA system integration applications
Utility.jar
Apache Open source organization provides tag library
Velocity-1.5.jar
A free open-source template framework
Wsdl4j-1.6.2.jar
WSDL file used to parse the service
Wss4j-1.5.4.jar
Create the jar required for CXF
Wstx-asl-3.2.6.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.